import request from '/@/utils/request';

/**
 * （不建议写成 request.post(xxx)，因为这样 post 时，无法 params 与 data 同时传参）
 *
 * 部门api接口集合
 * @method GetDepartment 获取所有部门
 * @method AddDepartment 添加部门
 * @method DeldEpartment 删除部门
 */
export function useDepartmentApi() {
	return {
		// 获取所有部门
		GetDepartment: (params: object) => {
			return request({
				url: '/api/ljr/Getdepartment',
				method: 'get',
				params,
			});
		},
		// 添加部门
		AddDepartment: (data: object) => {
			return request({
				url: '/api/ljr/Adddepartment',
				method: 'post',
				data,
			});
		},
		// 删除部门
		DeldEpartment: (params: object) => {
			return request({
				url: '/api/ljr/Deldepartment/' + params.id,
				method: 'DELETE',
				params,
			});
		},
	};
}
